steam_ugc_get_item_update_progress

语法:

steam_ugc_get_item_update_progress(ugc_update_handle, info_map);


参数 描述
ugc_update_handle The unique handle for the UGC to be updated.
info_map A (previously created) DS map index.


返回: 布尔值


描述

This function can be used to track the update status for an item. You give the item handle (as returned by the function steam_ugc_start_item_update) and an empty DS map which will then be populated with the following key/value pairs:

  1. "status_code" - The Steam status code

  2. "status_string" - A string for the current status

  3. "bytes_processed" - The bytes processed so far

  4. "bytes_total" - The total number of bytes in the update

If there is an error the function will return false and the map will be empty, otherwise the function returns true.


例如:

var uploadMap = ds_map_create();
steam_ugc_get_item_update_progress(global.itemHandle, uploadMap);
var statusCode = uploadMap[? "status_code"];
var status = uploadMap[? "status_string"];
var processed = uploadMap[? "bytes_processed"];
var total = uploadMap[? "bytes_total"];
draw_text(32, 0, "Upload info for item:" + string(global.itemHandle));
draw_text(32, 15, "status code:" + string(statusCode));
draw_text(32, 30, "status:" + string(status));
draw_text(32, 45, "bytes processed:" +string(processed));
draw_text(32, 60, "bytes total:" + string( total));
ds_map_destroy(uploadMap);

The above code will query the upload status of the item indexed in the global variable "itemHandle", using a ds_map to store the information. This is then parsed and the resulting values drawn to the screen.